const mongoose = require('mongoose')

mongoose.connect('mongodb://root:123456@82.157.189.16:27017/hotel?authSource=admin')

let conn = mongoose.connection

conn.on('open',()=>{
    console.log('数据库连接成功');
})

conn.on('error',(err)=>{
    console.log('数据库连接失败',err);
})

module.exports = mongoose